#include <iostream>
using namespace std;
int main(int argc, char **argv[])
{
  double x1, y1, x2, y2, a, b;
  cout << "x1, y1 = ";
  cin >> x1 >> y1;
  cout << "x2, y2 = ";
  cin >> x2 >> y2;
  cout << "P = " << 2 * (y2 - y1 + x2 - x1) << "\n S = " << (y2 - y1) * (x2 - x1);
  return 0;
}
